//
//  SetProfressionCell.m
//  A段项目
//
//  Created by dllo on 16/3/9.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "SetProfressionCell.h"

@interface SetProfressionCell ()







@end

@implementation SetProfressionCell

- (void)dealloc {
    
    [_leftLabel release];
    
    [_rightSwitch release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.leftLabel = [[UILabel alloc] init];
        
        [self.contentView addSubview:self.leftLabel];
        
        self.rightSwitch = [[UISwitch alloc] init];
        
        [self.rightSwitch addTarget:self action:@selector(rightSwitchAction:) forControlEvents:UIControlEventValueChanged];
        
        [self.contentView addSubview:self.rightSwitch];
        
        
        [_leftLabel release];
        
        [_rightSwitch release];
        
        
    }
    
    
    return self;
    
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    self.leftLabel.frame = CGRectMake(50, 0, 100, self.bounds.size.height);
    
    
    
    self.rightSwitch.frame = CGRectMake(self.bounds.size.width - 100, 0, 50, self.frame.size.height);
    
        
    
}

/**switch 点击事件. */

- (void)rightSwitchAction:(UISwitch *)rightSwitch {
    
    if (rightSwitch.on) {
        
        [self.delegate touchSwitch:self];
        
    }
    
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    }

@end
